package com.example.strategy.strategy;

/**
 * @Auther: chenxiuqi
 * @Date: 2020/4/27 20:26
 * @Description: 定义上下文
 */
public class MyStrategyContent {

    private String type;//策略方式

    private MyStrategy myStrategy;//策略接口

    public MyStrategyContent(String type, MyStrategy myStrategy) {
        this.type = type;
        this.myStrategy = myStrategy;
    }

    public MyStrategy getMyStrategy() {
        return myStrategy;
    }

    public boolean option(String type){
        return this.type.equals(type);
    }

}
